Repository navigation
Conversation
sceNetGetSockInfo always reported 0 in recv_queue_length, so a title that reads a socket only when its record shows queued data never reads. The record now carries the host's FIONREAD count; a socket the host refuses FIONREAD for keeps 0, the value a PS4 Pro on firmware 10.71 reports for an empty queue. The datagram difference between hosts and the other measured values of the record are recorded as technical debt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The console shares one descriptor space between the kernel socket calls and libSceNet, and sceNetGetSockInfo on a PS4 Pro (firmware 10.71) describes and lists a socket made with socket() as it does one made with sceNetSocket. AnyPS5 answered EBADF for such a descriptor and left it out of the s < 0 list. libkernel now describes one of its sockets (native handle with its owner, family, type, non-blocking mode) and lists its descriptors; sceNetGetSockInfo reads its own table first and the kernel's otherwise, without adopting the socket into libSceNet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nfo-kernel-sockets
|
I reviewed the descriptor lookup/listing changes and the new The PR reports |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
I tested the combined network changes on main The reproducible integration tree is After rebuilding libc, libkernel, libSceNet and the eight test targets:
The tests were guest_net_socket_state, guest_net_protocol, guest_net_buffer_validation, guest_net_boolean_readback, guest_sce_net_keepalive, guest_net_oob_inline, guest_sce_net and guest_net_nodelay_readback. Conventions and whitespace checks pass too. This supplies combined runtime evidence for the agreed ordering, including your kernel-created socket records. It is a focused local integration run; full hosted CI, a title and console hardware were not run. The remaining #6044/#5836 coordination is unchanged. |
MarcZX10
left a comment
There was a problem hiding this comment.
The new integration evidence answers my earlier Linux test request: the reported Windows 8/8 and WSL2 8/8 focused runs include this PR alongside #9932, #9930, #9931 and the other listed network changes, and retain the kernel-created socket record coverage. I also reran current-main whitespace and conventions checks; both pass.\n\nOne remaining integration gap: the branch is 5 commits ahead and 264 behind current main (merge base 895f47f4), while current main has since advanced libSceNet/Export.cpp and docs/dev/debt/libSceNet.md, both files changed here. The PR’s integration run is based on b7a451d, not current main. Please refresh on current main, preserve the already-merged queue-length and network changes in Export.cpp, and rerun the focused socket-info tests on the refreshed head. The KernelDescribeSocket owner lifetime and descriptor listing logic otherwise look sound in this pass; I found no separate defect.
MarcZX10
left a comment
There was a problem hiding this comment.
Please rebase/merge current main and rerun the focused guest_sce_net coverage. The branch is 264 commits behind (merge base 895f47f4), and current main has intervening edits in both libSceNet/Export.cpp and docs/dev/debt/libSceNet.md, which this PR changes. The reported 8/8 Windows + WSL2 integration run is useful and covers the dependency network changes, but used main b7a451d, so it does not validate this PR integrated with today’s sceNetGetSockInfo queue-length and related network updates. Current-main diff-check and conventions pass; this request is specifically for resolving those shared-file updates and retesting the final head.
…unts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nfo-kernel-sockets # Conflicts: # docs/dev/debt/libSceNet.md
|
Thanks for the review. I merged current Thanks also for counting Queuse's Windows and WSL2 integration run as the Linux evidence. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nfo-kernel-sockets # Conflicts: # docs/dev/debt/libSceNet.md
|
Updated to 1d95b47: merged the refreshed #9932 (641b92a, with |
…ockInfo6 to the socket source Main's fill_sock_info6 (from the IPv6 sockinfo work) read a Sock and called sock_buffer_size(Sock); this PR's sock_buffer_size takes a SockInfoSource. fill_sock_info6 now builds a SockInfoSource from the registered socket only, so its behaviour is unchanged: a socket made with socket() is still not described by sceNetGetSockInfo6. Main's header declarations replace the test's local ones; the SO_* wording of main's debt entries is kept and the PR's sockinfo entries follow it.
…o (upstream boykopovar#11242, boykopovar#11243, boykopovar#9948) (#25) * fix(libSceNet): register libkernel sockets with sceNetEpollControl Human Fall Flat (PPSA02429) opens its sockets with libkernel's socket() and registers them with sceNetEpollControl. libSceNet only looked in its own socket table, so every ADD and DEL failed with SCE_NET_ERROR_EBADF. The game retries without pause: on box 2 it made more than 1.6 million failing calls on 14 descriptors in its first seconds, all of them libkernel sockets. sceNetEpollControl now accepts a descriptor libkernel has open as a socket, as sceNetSocketClose and sceNetSetsockopt already do for MXGP 26 (PPSA30839). sceNetEpollWait looks up the host socket of such a registration through libkernel after g_mutex is released, because that lookup asks libSceNet's own table for descriptors libkernel does not own, and keeps the owner alive across the host poll. libkernel's close() retires the registrations of the closed socket; a wait drops a registration whose socket is gone. guest_sce_net registers a libkernel UDP socket, waits for it to become readable and then writable, deletes it twice, closes registered sockets through close() and sceKernelClose and waits again, and checks that a descriptor that was never open still fails with EBADF. From boykopovar#11242 * fix(libkernel): retire epoll registrations of a socket closed with sceKernelClose From boykopovar#11242 * fix(libSceNet): read an option of a libkernel socket through sceNetGetsockopt Human Fall Flat (PPSA02429) opens its sockets with libkernel's socket() and reads options of them with sceNetGetsockopt. libSceNet only looked in its own socket table, so each call failed with SCE_NET_ERROR_EBADF. On the console both calls work on the same kernel sockets, the position sceNetSetsockopt already takes for MXGP 26 (PPSA30839). A descriptor libSceNet does not own but libkernel has open as a socket now goes to libkernel's getsockopt(), which answers the options it models. Anything else still fails with EBADF. The fallback runs after g_mutex is released. guest_sce_net reads SO_SNDBUF and TCP_NODELAY of a libkernel TCP socket through sceNetGetsockopt, checks that an unknown level fails with EINVAL, and that the call fails with EBADF once the socket is closed. From boykopovar#11243 * fix(libSceNet): report the receive queue length in sceNetGetSockInfo sceNetGetSockInfo always reported 0 in recv_queue_length, so a title that reads a socket only when its record shows queued data never reads. The record now carries the host's FIONREAD count; a socket the host refuses FIONREAD for keeps 0, the value a PS4 Pro on firmware 10.71 reports for an empty queue. The datagram difference between hosts and the other measured values of the record are recorded as technical debt. From boykopovar#9948 * fix(libSceNet): describe sockets made with socket() in sceNetGetSockInfo The console shares one descriptor space between the kernel socket calls and libSceNet, and sceNetGetSockInfo on a PS4 Pro (firmware 10.71) describes and lists a socket made with socket() as it does one made with sceNetSocket. AnyPS5 answered EBADF for such a descriptor and left it out of the s < 0 list. libkernel now describes one of its sockets (native handle with its owner, family, type, non-blocking mode) and lists its descriptors; sceNetGetSockInfo reads its own table first and the kernel's otherwise, without adopting the socket into libSceNet. From boykopovar#9948 * test(libSceNet): drop libkernel declarations that Api.hpp already provides --------- Co-authored-by: Josip Parlov <josipparlov@protonmail.com> Co-authored-by: ntamas94 <ntamas@live.com>
What
On the console the kernel socket calls and libSceNet share one descriptor space:
sceNetGetSockInfodescribes a socket made withsocket()exactly like one made withsceNetSocket, and lists it whensis below 0. AnyPS5 answeredEBADFfor such a descriptor and left it out of the list, because libSceNet only looked in its own table. Knowledge is Power: Decades (CUSA12435) callssceNetGetSockInfoon its PlayLink server socket, which it makes withsocket(), right after binding it, and reads from it only whenrecv_queue_lengthis not 0 (#9932).libkernel now exports two helpers next to
KernelLookupSocketNative_nid_no_patch:KernelDescribeSocket_nid_no_patchreturns one of its sockets' native handle together with the owner that keeps it open, its family, type and non-blocking mode, andKernelListSockets_nid_no_patchlists its descriptors.sceNetGetSockInforeads its own table first and the kernel's otherwise, and merges both into the sorted list. The socket is not adopted into libSceNet's table, so closing it withclose()leaves nothing stale behind. Other sceNet calls on such a socket still answerEBADF; the debt entry says so.sock_buffer_sizenow takes the record's source (native handle and configured sizes) instead of aSock; #8362 calls it with aSockin its newfill_sock_info6, so whichever of the two lands second needs that call adapted.guest_sce_netgains rows for a UDP socket made withsocket_nid_postfixand bound to 127.0.0.1: its record (descriptor, type 2, address, port,SELFflag, buffer sizes), its place in the list, andEBADFafterclose_nid_postfix. With the oldExport.cpp,SocketPoll.hppandUdp.cppthe test aborts at the first new row.Tested
Windows 11, MinGW-w64 GCC (winlibs), Ninja:
guest_sce_netpassed on the final head (659962c,main895f47f),python tools/check_conventions.py --base origin/mainpasses. Measured on a PS4 Pro (firmware 10.71) with a homebrew probe: a bound UDP socket fromsocket()and one fromsceNetSocketboth return 1 with a full record, andsceNetGetSockInfo(-1, NULL, 0, 0)counts both:Not run with a title.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)